
log using "C:\Users\hongj\Dropbox\2024 SPRING PROJECTS\Organizational Memory Paper\JPART Replication Datafiles\OUTPUT\OUTPUT.Organizational Memory.MANUSCRIPT.04-30-2025.smcl", replace

*******************************************************************************************************************************************************************************************************************************
use "C:\Users\hongj\Dropbox\2024 SPRING PROJECTS\Organizational Memory Paper\2024June Data\FINAL DATABASE\Organizational Memory.FINAL DATABASE.04-29-2025.dta", replace


*
*
*

egen a_id = group(bureau_opm)

* COMPUTE: Compute the FE estimator as a pooled OLS estimator using the Mundlak device (Papke and Wooldridge 2008)
egen turnoverb = mean(turnover), by(a_id)
egen itsepabove15_los15pctb = mean(itsepabove15_los15pct), by(a_id)

egen turnover_gs13b = mean(turnover_gs13), by(a_id)
egen gs13above15_los15pctb = mean(gs13above15_los15pct), by(a_id)

egen voluntaryb = mean(voluntary), by(a_id)
egen volabove15_los15pctb = mean(volabove15_los15pct), by(a_id)

egen involuntaryb = mean(involuntary), by(a_id)
egen involabove15_los15pctb = mean(involabove15_los15pct), by(a_id)

egen voluntary_gs13b = mean(voluntary_gs13), by(a_id)
egen volgs13_los15pctb = mean(volgs13_los15pct), by(a_id)

egen involuntary_gs13b = mean(involuntary_gs13), by(a_id)
egen involgs13_los15pctb = mean(involgs13_los15pct), by(a_id)


egen activityno_permil_pctb = mean(activityno_permil_pct), by(a_id)
egen cio_tenureb = mean(cio_tenure), by(a_id)
egen lnitempb = mean(lnitemp), by(a_id)
egen lnprojsizeb = mean(lnprojsize), by(a_id)
egen projects_nob = mean(projects_no), by(a_id)
egen accrateb = mean(accrate), by(a_id)
egen newprojects_pctb = mean(newprojects_pct), by(a_id)
egen dmeratio_totalspendingb = mean(dmeratio_totalspending), by(a_id)


save "C:\Users\hongj\Dropbox\2024 SPRING PROJECTS\Organizational Memory Paper\JPART Replication Datafiles\DATA\Organizational Memory.STATISTICAL DATABASE.04-30-2025.dta", replace

*******************************************************************************************************************************************************************************************************************************

quietly eststo: xtgee delay_pct c.turnover itsepabove15_los15pct i.cio5 activityno_permil_pct cio_tenure lnitemp lnprojsize projects_no accrate  newprojects_pct y1-y7 turnoverb itsepabove15_los15pctb  activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb   dmeratio_totalspending dmeratio_totalspendingb, fam(bin) link(probit) corr(uns) vce(robust)

/* Set global */
sum turnover if e(sample), detail
global turnover_p10 = round(r(p10),0.01)
global turnover_p90 = round(r(p90),0.01)

sum turnover_gs13 if e(sample), detail
global turnovergs13_p10 = round(r(p10),0.01)
global turnovergs13_p90 = round(r(p90),0.01)

sum voluntary if e(sample), detail
global voluntary_p10 = round(r(p10),0.01)
global voluntary_p90 = round(r(p90),0.01)

sum involuntary if e(sample), detail
global involuntary_p10 = round(r(p10),0.01)
global involuntary_p90 = round(r(p90),0.01)

sum voluntary_gs13 if e(sample), detail
global voluntary_gs13_p10 = round(r(p10),0.01)
global voluntary_gs13_p90 = round(r(p90),0.01)

sum involuntary_gs13 if e(sample), detail
global involuntary_gs13_p10 = round(r(p10),0.01)
global involuntary_gs13_p90 = round(r(p90),0.01)
*
*
*
sum itsepabove15_los15pct if e(sample), detail
global los_p10 = round(r(p10),0.01)
global los_p90 = round(r(p90),0.01)

sum volabove15_los15pct if voluntary>0 & e(sample), detail
global vollos_p10 = round(r(p10),0.01)
global vollos_p90 = round(r(p90),0.01)

sum involabove15_los15pct if involuntary>0 & e(sample), detail
global invollos_p10 = round(r(p10),0.01)
global invollos_p90 = round(r(p90),0.01)

sum gs13above15_los15pct if turnover_gs13>0 & e(sample), detail
global gs13_los_p10 = round(r(p10),0.01)
global gs13_los_p90 = round(r(p90),0.01)

sum volgs13_los15pct if voluntary_gs13>0 & e(sample), detail
global volgs13_los_p10 = round(r(p10),0.01)
global volgs13_los_p90 = round(r(p90),0.01)

sum involgs13_los15pct if involuntary_gs13>0 & e(sample), detail
global involgs13_los_p10 = round(r(p10),0.01)
global involgs13_los_p90 = round(r(p90),0.01)
*
*
*
sum activityno_permil_pct if e(sample), detail
global stdz_p10 = round(r(p10),0.01)
global stdz_p90 = round(r(p90),0.01)

***********************************************
* DESCRIPTIVES
xtsum turnover turnover_gs13 voluntary involuntary voluntary_gs13 involuntary_gs13  itsepabove15_los15pct volabove15_los15pct involabove15_los15pct gs13above15_los15pct volgs13_los15pct involgs13_los15pct cio5 activityno_permil_pct  lnitemp lnprojsize projects_no accrate  newprojects_pct cio_tenure dmeratio_totalspending if e(sample)
***********************************************

sum delay_pct if e(sample)
di r(sd)

hist delay0_pct if e(sample)

discard

*********************************************************************************************************************************************************************************************************************************




**# [MODELS 1 - 4] [FIGURES 3A-6A] AGGREGATE TURNOVER MODELS



* [M1, FIGURE 3A] H1: Turnover Baseline Effects
eststo: xtgee delay_pct c.turnover itsepabove15_los15pct i.cio5 activityno_permil_pct cio_tenure lnitemp lnprojsize projects_no accrate  newprojects_pct y1-y7 turnoverb itsepabove15_los15pctb  activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb, fam(bin) link(probit) corr(uns) vce(robust)

* Aggregate Turnover Rate: Unconditional Marginal Effect 
margins, dydx(turnover) 

* Predicted Change in Delays Based on Interdecile Increase in Aggregate Turnover Rate
margins, at(turnover=($turnover_p10 $turnover_p90)) pwcompare(effects)

* [FIGURE 3A] Unconditional Aggregate Turnover Effects on Project Delays (H1)
margins, at(turnover=(0(0.01)0.15)) 
marginsplot, recast(connected) plot1opts(lcolor(black%60) mcolor(black%60))  ciopt(color(black%30))  recastci(rarea) ///
xlabel(0 "0" 0.05 "5" 0.1 "10" 0.15 "15",format(%9.0f) ) ylabel(0.1 "10" 0.2 "20" 0.3 "30" 0.4 "40" 0.5 "50",format(%9.0f) angle(0)) ///
legend(off) ///
ytitle("Predicted Project Delays (%)", size(11pt) margin(r=1)) xtitle("Aggregate Turnover (%)", margin(t=1)  size(11pt) ) ///
title("{bf: Figure 3A. Unconditional Turnover Effects on Project Delays (H1)}" "{bf:Aggregate Turnover Model [MODEL 1]}", size(12pt) margin(medium)) ysc(r(0.1 0.5)) ///
addplot(histogram turnover if turnover<=0.15, fc(gray%20) lc(gray%10) yaxis(2) yscale(r(0 20) axis(2) alt) xlabel(0 "0" 0.05 "5" 0.1 "10" 0.15 "15",format(%9.0f)) ylabel(0.1 "10" 0.2 "20" 0.3 "30" 0.4 "40" 0.5 "50",format(%9.0f) angle(0)) ylabel(,format(%9.0f) angle(0) axis(2)) ytitle(,axis(2))) xsize(6) 

graph save "Graph" "C:\Users\hongj\Dropbox\2024 SPRING PROJECTS\Organizational Memory Paper\JPART Replication Datafiles\GRAPHICS\FIGURE 3A.04-29-2025.gph", replace
*
*
*generate average cost per project variable for substantive interpretation
gen cost_perproj = projects_size/projects_no
sum cost_perproj if e(sample)
* mean: 7.194648
di 7.20*5.34

*******************************************************************************************************************************************************************************************************************************

* [M2, FIGURE 4A] H2: Turnover X Service Length
eststo: xtgee delay_pct c.turnover##c.itsepabove15_los15pct i.cio5 activityno_permil_pct cio_tenure lnitemp lnprojsize projects_no accrate  newprojects_pct y1-y7 turnoverb itsepabove15_los15pctb  activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb   dmeratio_totalspending dmeratio_totalspendingb, fam(bin) link(probit) corr(uns) vce(robust)

* Aggregate Turnover Rate: Marginal Effect Differentials Based on Interdecile Change in Service Length
margins, dydx(turnover) at(itsepabove15_los15pct=($los_p10 $los_p90)) pwcompare(effects)

* [FIGURE 4A] Conditional Turnover Effects by Departures' Service Length (H2)
margins, dydx(turnover) at(itsepabove15_los15pct=(0(0.025)0.2))
marginsplot, recast(connected) plot1opts(lcolor(black%60) mcolor(black%60))  ciopt(color(black%30)) yline(0, lcolor(red) lpattern(shortdash)) recastci(rarea) ///
xlabel(0 "0" 0.1 "10" 0.2 "20" ,format(%9.0f) ) ylabel(,format(%9.1f) angle(0)) ///
legend(off) ///
ytitle("Marginal Change in Delayed Projects (%)", size(11pt) margin(r=1)) xtitle("Departing Employees' Service Length (>15 years, %)", margin(t=1)  size(11pt) ) ///
title("{bf: Figure 4A. Conditional Turnover Effects by Departures' Service Length (H2)}" "{bf:Aggregate Turnover Model [MODEL 2]}", size(12pt) margin(medium)) ///
addplot(histogram itsepabove15_los15pct if itsepabove15_los15pct<=0.2 & turnover>0, fc(gray%20) lc(gray%10) yaxis(2) yscale(r(0 20) axis(2) alt) xlabel(0 "0" 0.1 "10" 0.2 "20" ,format(%9.0f)) ylabel(,format(%9.1f) angle(0) ) ylabel(0 "0" 5 "5" 10 "10" 15 "15" 20 "20",format(%9.0f) angle(0) axis(2)) ytitle(,axis(2))) xsize(6) 

graph save "Graph" "C:\Users\hongj\Dropbox\2024 SPRING PROJECTS\Organizational Memory Paper\JPART Replication Datafiles\GRAPHICS\FIGURE 4A.04-29-2025.gph", replace

*******************************************************************************************************************************************************************************************************************************

* [M3, FIGURE 5A] H3: Turnover X Agency Centralization
eststo: xtgee delay_pct c.turnover##i.cio5 c.itsepabove15_los15pct  activityno_permil_pct cio_tenure lnitemp lnprojsize projects_no accrate  newprojects_pct y1-y7 turnoverb itsepabove15_los15pctb  activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb , fam(bin) link(probit) corr(uns) vce(robust)

* Aggregate Turnover Rate: Marginal Effect Differentials Based on Agency Centralization
margins , dydx(turnover) over(cio5) pwcompare(effects)

* [FIGURE 5A] Conditional Turnover Effects by Agency Centralization (H3)
margins , dydx(turnover) over(cio5)
marginsplot, recast(scatter) plotopt(mcolor(black)) ciopt(color(black%60))  yline(0, lcolor(red) lpattern(shortdash)) ///
xlabel (-1 " " 0 "No Centralization" 1 "Centralization" 2 " ", labsize(11pt) noticks) plot1opts(msize(medlarge) msymbol(square)) legend(off) ///
ylabel(,format(%9.1f) angle(0))   ///
ytitle("Marginal Change in Project Delays (%)", size(11pt) margin(r=1)) xtitle("" ) ///
title("{bf: Figure 5A. Conditional Turnover Effects by Agency Centralization (H3)}" "{bf:Aggregate Turnover Model [MODEL 3]}", size(12pt) margin(medium)) ///
addplot(histogram cio5, yaxis(2) discrete barwidth(0.4) fcolor(gray%20) yscale(r(0 1.5) axis(2) alt) lc(gray%10) ytitle(,axis(2)) xlabel(-1 " " 0 "No Centralization" 1"Centralization" 2 " ", noticks) ylabel(0 "0" 0.5 "0.5" 1 "1.0" 1.5 "1.5" , format(%9.1f) angle(0) axis(2)) ylabel(, format(%9.1f) angle(0) axis(1))) xsize(6)

graph save "Graph" "C:\Users\hongj\Dropbox\2024 SPRING PROJECTS\Organizational Memory Paper\JPART Replication Datafiles\GRAPHICS\FIGURE 5A.04-29-2025.gph", replace

******************************************************************************************************************************************************************************************************************************

* [M4, FIGURE 6A] H4: Turnover X Task Standardization
eststo: xtgee delay_pct c.turnover##c.activityno_permil_pct i.cio5 c.itsepabove15_los15pct   cio_tenure lnitemp lnprojsize projects_no accrate  newprojects_pct y1-y7 turnoverb itsepabove15_los15pctb  activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb , fam(bin) link(probit) corr(uns) vce(robust)

* Aggregate Turnover Rate: Marginal Effect Differentials Based on Task Standardization
margins , dydx(turnover) at(activityno_permil_pct=($stdz_p10 $stdz_p90)) pwcompare(effects)

* [FIGURE 6A] Conditional Turnover Effects by Task Standardization (H4)
margins , dydx(turnover) at(activityno_permil_pct=(0(0.1)1))
marginsplot, recast(connected) plot1opts(lcolor(black%60) mcolor(black%60))  ciopt(color(black%30)) yline(0, lcolor(red) lpattern(shortdash)) recastci(rarea) ///
legend(off) ylabel(,format(%9.1f) angle(0)) /// ///
xlabel(0 "0" 0.5 "50" 1 "100",format(%9.0f)) ylabel(,format(%9.1f) angle(0)) ///
ytitle("Marginal Change in Delayed Projects (%)", size(11pt) margin(r=1)) xtitle("Proportion of Standardized Projects (%)", size(11pt) margin(t=1)) ///
title("{bf: Figure 6A. Conditional Turnover Effects by Task Standardization (H4)}" "{bf:Aggregate Turnover Model [MODEL 4]}", size(12pt) margin(medium)) ///
addplot(histogram activityno_permil_pct , yaxis(2) xaxis(1) fcolor(gray%20) lc(gray%10) yscale(axis(2) alt) xlabel(0 "0" 0.5 "50" 1 "100",format(%9.0f)) ylabel(,format(%9.1f) angle(0))  ylabel( ,format(%9.1f) angle(0) axis(2)) ytitle(, axis(2))) xsize(6) 

graph save "Graph" "C:\Users\hongj\Dropbox\2024 SPRING PROJECTS\Organizational Memory Paper\JPART Replication Datafiles\GRAPHICS\FIGURE 6A.04-29-2025.gph", replace

******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************

**# [MODEL 5 - 8] [FIGURES 3D-6D] MANAGERIAL TURNOVER MODELS

* [M5, FIGURE 3D] H1: Managerial Turnover Baseline Effects
 
eststo: xtgee delay_pct c.turnover_gs13  gs13above15_los15pct cio5 activityno_permil_pct cio_tenure  lnitemp lnprojsize projects_no accrate  newprojects_pct y1-y7 turnover_gs13b gs13above15_los15pctb activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb   , fam(bin) link(probit) corr(uns) vce(robust)

* Managerial Turnover Rate: Unconditional Marginal Effect 
margins, dydx(turnover_gs13)

* Predicted Change in Delays Based on Interdecile Increase in Managerial Turnover Rate
margins, at(turnover_gs13=($turnovergs13_p10 $turnovergs13_p90)) pwcompare(effects)

* [FIGURE 3D] Unconditional Managerial Turnover Effects on Project Delays
margins, at(turnover_gs13=(0(0.01)0.15)) 
marginsplot, recast(connected) plot1opts(lcolor(black%60) mcolor(black%60))  ciopt(color(black%30)) recastci(rarea) ///
xlabel(0 "0" 0.05 "5" 0.1 "10" 0.15 "15",format(%9.0f) ) ylabel(0.1 "10" 0.2 "20" 0.3 "30" 0.4 "40" 0.5 "50",format(%9.0f) angle(0)) ///
legend(off) ///
ytitle("Predicted Project Delays (%)", size(11pt) margin(r=1)) xtitle("Managerial Turnover (%)", margin(t=1)  size(11pt) ) ///
title("{bf: Figure 3D. Unconditional Turnover Effects on Project Delays (H1)}" "{bf:Managerial Turnover Model [MODEL 5]}", size(12pt) margin(medium)) ///
addplot(histogram turnover_gs13 if turnover_gs13<=0.15, fc(gray%20) lc(gray%10) yaxis(2) yscale(r(0 20) axis(2) alt) xlabel(0 "0" 0.05 "5" 0.1 "10" 0.15 "15",format(%9.0f)) ylabel(0.1 "10" 0.2 "20" 0.3 "30" 0.4 "40" 0.5 "50",format(%9.0f) angle(0)) ylabel(,format(%9.0f) angle(0) axis(2)) ytitle(,axis(2))) xsize(6) 

graph save "Graph" "C:\Users\hongj\Dropbox\2024 SPRING PROJECTS\Organizational Memory Paper\JPART Replication Datafiles\GRAPHICS\FIGURE 3D.04-29-2025.gph", replace
***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************

* [MODEL 6, FIGURE 4D] H2: Turnover X Service Length

eststo: xtgee delay_pct c.turnover_gs13##c.gs13above15_los15pct cio5   activityno_permil_pct cio_tenure lnitemp lnprojsize projects_no accrate  newprojects_pct y1-y7 c.turnover_gs13b##c.gs13above15_los15pctb activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb   , fam(bin) link(probit) corr(uns) vce(robust)

* Managerial Turnover Rate: Marginal Effect Differentials Based on Interdecile Change in Service Length
margins, dydx(turnover_gs13) at(gs13above15_los15pct=($gs13_los_p10 $gs13_los_p90)) pwcompare(effects)

* [FIGURE 4D] Conditional Turnover Effects by Departures' Service Length (H2)
margins, dydx(turnover_gs13) at(gs13above15_los15pct=(0(0.025)0.2))
marginsplot, recast(connected) plot1opts(lcolor(black%60) mcolor(black%60))  ciopt(color(black%30)) yline(0, lcolor(red) lpattern(shortdash)) recastci(rarea) ///
xlabel(0 "0" 0.1 "10" 0.2 "20" ,format(%9.0f) ) ylabel( ,format(%9.1f) angle(0)) ///
legend(off) ///
ytitle("Marginal Change in Delayed Projects (%)", size(11pt) margin(r=1)) xtitle("Departing Managers' Service Length (>15 years, %)", margin(t=1)  size(11pt) ) ///
title("{bf: Figure 4D. Conditional Turnover Effects by Departures' Service Length (H2)}" "{bf:Managerial Turnover Model [MODEL 6]}", size(12pt) margin(medium)) ///
addplot(histogram gs13above15_los15pct if gs13above15_los15pct<=0.2 , fc(gray%20) lc(gray%10) yaxis(2) yscale(axis(2) alt) xlabel(0 "0" 0.1 "10" 0.2 "20" ,format(%9.0f)) ylabel( ,format(%9.1f) angle(0) ) ylabel(,format(%9.0f) angle(0) axis(2)) ytitle(,axis(2))) xsize(6) 

graph save "Graph" "C:\Users\hongj\Dropbox\2024 SPRING PROJECTS\Organizational Memory Paper\JPART Replication Datafiles\GRAPHICS\FIGURE 4D.04-29-2025.gph", replace
***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************

* [MODEL 7, FIGURE 5D] H3: Turnover X Agency Centralization

eststo: xtgee delay_pct c.turnover_gs13##i.cio5 c.activityno_permil_pct cio_tenure newprojects_pct gs13above15_los15pct lnitemp lnprojsize projects_no accrate  newprojects_pct y1-y7 c.turnover_gs13b c.activityno_permil_pctb gs13above15_los15pctb  lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb, fam(bin) link(probit) corr(uns) vce(robust)

* Mangerial Turnover Rate: Marginal Effect Differentials Based on Agency Centralization
margins , dydx(turnover_gs13) over(cio5) pwcompare(effects)

* [FIGURE 5D] Conditional Turnover Effects by Agency Centralization (H3)
margins , dydx(turnover_gs13) over(cio5)
marginsplot, recast(scatter) plotopt(mcolor(black)) ciopt(color(black%60))  yline(0, lcolor(red) lpattern(shortdash)) ///
xlabel (-1 " " -0.1 "No Centralization" 1 "Centralization" 2 " ", labsize(11pt) noticks) plot1opts(msize(medlarge) msymbol(square)) legend(off) ///
ylabel(,format(%9.1f) angle(0)) ///
ytitle("Marginal Change in Project Delays (%)", size(11pt) margin(r=1)) xtitle("" ) ///
title("{bf: Figure 5D. Conditional Turnover Effects by Agency Centralization (H3)}" "{bf:Managerial Turnover Model [MODEL 7]}", size(12pt) margin(medium)) ///
addplot(histogram cio5, yaxis(2) discrete barwidth(0.4) fcolor(gray%20) yscale(r(0 1.5) axis(2) alt) lc(gray%10) ytitle(,axis(2)) xlabel(-1 " " 0 "No Centralization" 1"Centralization" 2 " ", noticks) ylabel(0 "0" 0.5 "0.5" 1 "1.0" 1.5 "1.5" , format(%9.1f) angle(0) axis(2)) ylabel(, format(%9.1f) angle(0) axis(1))) xsize(6)

graph save "Graph" "C:\Users\hongj\Dropbox\2024 SPRING PROJECTS\Organizational Memory Paper\JPART Replication Datafiles\GRAPHICS\FIGURE 5D.04-29-2025.gph", replace

***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************

* [MODEL 8, FIGURE 6D] H4: Turnover X Task Standardization

eststo: xtgee delay_pct c.turnover_gs13##c.activityno_permil_pct newprojects_pct gs13above15_los15pct cio5 cio_tenure lnitemp lnprojsize projects_no accrate  y1-y7 c.turnover_gs13b c.activityno_permil_pctb gs13above15_los15pctb  lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb   , fam(bin) link(probit) corr(uns) vce(robust)

* Managerial Turnover Rate: Marginal Effect Differentials Based on Interdecile Change in Task Standardization
margins , dydx(turnover_gs13) at(activityno_permil_pct=($stdz_p10 $stdz_p90)) pwcompare(effects)

* [FIGURE 6D] Conditional Turnover Effects by Task Standardization (H4)
margins , dydx(turnover_gs13) at(activityno_permil_pct=(0(0.1)1))
marginsplot, recast(connected) plot1opts(lcolor(black%60) mcolor(black%60))  ciopt(color(black%30)) yline(0, lcolor(red) lpattern(shortdash)) recastci(rarea) ///
legend(off) ylabel(,format(%9.1f) angle(0)) /// ///
xlabel(0 "0" 0.5 "50" 1 "100",format(%9.0f)) ylabel(,format(%9.1f) angle(0)) ///
ytitle("Marginal Change in Delayed Projects (%)", size(11pt) margin(r=1)) xtitle("Proportion of Standardized Projects (%)", margin(t=1) size(11pt)) ///
title("{bf: Figure 6D. Conditional Turnover Effects by Task Standardization (H4)}" "{bf:Managerial Turnover Model [MODEL 8]}", size(12pt) margin(medium)) ///
addplot(histogram activityno_permil_pct , yaxis(2) xaxis(1) fcolor(gray%20) lc(gray%10) yscale(axis(2) alt) xlabel(0 "0" 0.5 "50" 1 "100",format(%9.0f)) ylabel( ,format(%9.1f) angle(0))  ylabel( ,format(%9.1f) angle(0) axis(2)) ytitle(, axis(2))) xsize(6) 

graph save "Graph" "C:\Users\hongj\Dropbox\2024 SPRING PROJECTS\Organizational Memory Paper\JPART Replication Datafiles\GRAPHICS\FIGURE 6D.04-29-2025.gph", replace
*
****************************************************************************************************************************************************
* [TABLE A1. MODELS A1 - A4; AGGREGATE TURNOVER MODELS]
cd "C:\Users\hongj\Dropbox\2024 SPRING PROJECTS\Organizational Memory Paper\JPART Replication Datafiles\OUTPUT\TABLES"

esttab est1 est2 est3 est4 using ManuscriptTable1.04-29-2025.rtf, ///
cells(b(star fmt(%9.3f)) se(par) p(fmt(3) par("[" "]"))) starl( * 0.10 ** 0.05 *** 0.010) label ///
title(TABLE 1. Fractional Panel Probit Analysis of the Impact of Aggregate Voluntary and Involuntary Turnover on IT Project Delays in U.S. Federal Agencies, FY2015−FY2021) ///
nonumbers mtitles("Model 1" "Model 2" "Model 3" "Model 4" )  ///
stats(year qic pseudor chi2 N, fmt(2) label("Year Fixed Effects" "QIC" "Pseudo R-Squared" "Wald" "N")) replace

esttab est5 est6 est7 est8 using ManuscriptTable1.04-29-2025.rtf, ///
cells(b(star fmt(%9.3f)) se(par) p(fmt(3) par("[" "]"))) starl( * 0.10 ** 0.05 *** 0.010) label ///
title(TABLE 1. Fractional Panel Probit Analysis of the Impact of Aggregate Voluntary and Involuntary Turnover on IT Project Delays in U.S. Federal Agencies, FY2015−FY2021) ///
nonumbers mtitles("Model 5" "Model 6" "Model 7" "Model 8")  ///
stats(year qic pseudor chi2 N, fmt(2) label("Year Fixed Effects" "QIC" "Pseudo R-Squared" "Wald" "N")) append
****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
discard

**# * [MODEL 9 - 12] [FIGURES 3B-6B] AGGREGATE VOLUNTARY TURNOVER MODELS


* [MODEL 9, FIGURE 3B] H1: Aggregate Voluntary Turnover Baseline Effects
eststo: xtgee delay_pct c.voluntary volabove15_los15pct cio5 activityno_permil_pct lnitemp lnprojsize projects_no accrate  newprojects_pct  cio_tenure y1-y7 voluntaryb volabove15_los15pctb  activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb , fam(bin) link(probit) corr(uns) vce(robust)

* Aggregate Voluntary Turnover Rate: Unconditional Marginal Effect 
margins, dydx(voluntary)

* Predicted Change in Delays Based on Interdecile Increase in Aggregate Voluntary Turnover Rate
margins, at(voluntary=($voluntary_p10 $voluntary_p90)) pwcompare(effects)

* [FIGURE 3B] Unconditional Turnover Effects on Project Delays (H1)
margins, at(voluntary=(0(0.01)0.15)) 
marginsplot, recast(connected) plot1opts(lcolor(black%60) mcolor(black%60))  ciopt(color(black%30)) recastci(rarea) ///
xlabel(0 "0" 0.05 "5" 0.1 "10" 0.15 "15",format(%9.0f) ) ylabel(0.1 "10" 0.2 "20" 0.3 "30" 0.4 "40" 0.5 "50",format(%9.0f) angle(0)) ///
legend(off) ///
ytitle("Predicted Project Delays (%)", size(11pt) margin(r=1)) xtitle("Aggregate Voluntary Turnover (%)", margin(t=1)  size(11pt) ) ///
title("{bf: Figure 3B. Unconditional Turnover Effects on Project Delays (H1)}" "{bf:Aggregate Voluntary Turnover Model [MODEL 9]}", size(12pt) margin(medium)) ///
addplot(histogram voluntary if voluntary<=0.15, fc(gray%20) lc(gray%10) yaxis(2) yscale(r(0 20) axis(2) alt) xlabel(0 "0" 0.05 "5" 0.1 "10" 0.15 "15",format(%9.0f)) ylabel(0.1 "10" 0.2 "20" 0.3 "30" 0.4 "40" 0.5 "50",format(%9.0f) angle(0)) ylabel(,format(%9.0f) angle(0) axis(2)) ytitle(,axis(2))) xsize(6) 

graph save "Graph" "C:\Users\hongj\Dropbox\2024 SPRING PROJECTS\Organizational Memory Paper\JPART Replication Datafiles\GRAPHICS\FIGURE 3B.04-29-2025.gph", replace
*
*
******************************************************************************************************************************************************************
*********************************************************************************

* [MODEL 10, FIGURE 4B] H2: Turnover X Service Length
eststo: xtgee delay_pct c.voluntary##c.volabove15_los15pct cio5 activityno_permil_pct lnitemp lnprojsize projects_no accrate  newprojects_pct  cio_tenure y1-y7 voluntaryb volabove15_los15pctb  activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb  , fam(bin) link(probit) corr(uns) vce(robust)

* Aggregate Voluntary Turnover Rate: Marginal Effect Differentials Based on Interdecile Change in Service Length
margins , dydx(voluntary) at(volabove15_los15pct=($vollos_p10 $vollos_p90)) pwcompare(effects)

margins , dydx(voluntary) at(volabove15_los15pct=(0(0.025)0.2))
marginsplot, recast(connected) plot1opts(lcolor(black%60) mcolor(black%60))  ciopt(color(black%30)) yline(0, lcolor(red) lpattern(shortdash)) recastci(rarea) ///
legend(off) ylabel(,format(%9.1f) angle(0)) /// ///
xlabel(0 "0" 0.05 "5" 0.1 "10" 0.15 "15" 0.2 "20" ,format(%9.0f)) ///
ytitle("Marginal Change in Delayed Projects (%)", size(11pt) margin(r=1)) xtitle("Departures' Service Length (>15 years, %)", margin(t=1)  size(11pt)) ///
title("{bf: Figure 4B. Conditional Turnover Effects by Departures' Service Length (H2)}" "{bf:Aggregate Voluntary Turnover Model [MODEL 10]}", size(12pt) margin(medium)) ///
addplot(histogram volabove15_los15pct if volabove15_los15pct<=0.2 , yaxis(2) xaxis(1)  fcolor(gray%20) yscale(axis(2) alt) lc(gray%20) xlabel(0 "0" 0.05 "5" 0.1 "10" 0.15 "15" 0.2 "20" ,format(%9.0f)) ylabel( ,format(%9.1f) angle(0) ) ylabel(,format(%9.0f) angle(0) axis(2)) ) xsize(6)


graph save "Graph" "C:\Users\hongj\Dropbox\2024 SPRING PROJECTS\Organizational Memory Paper\JPART Replication Datafiles\GRAPHICS\FIGURE 4B.04-29-2025.gph", replace


******************************************************************************************************************************************************************
*********************************************************************************

* [MODEL 11, FIGURE 5B] H3: Turnover X Agency Centralization
eststo: xtgee delay_pct c.voluntary##i.cio5 c.volabove15_los15pct activityno_permil_pct lnitemp lnprojsize projects_no accrate  newprojects_pct  cio_tenure y1-y7 voluntaryb volabove15_los15pctb  activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb , fam(bin) link(probit) corr(uns) vce(robust)

* Aggregate Voluntary Turnover Rate: Marginal Effect Differentials Based on Agency Centralization
margins , dydx(voluntary) over(cio5) pwcompare(effects)


margins , dydx(voluntary) over(cio5)
marginsplot, recast(scatter) plotopt(mcolor(black)) ciopt(color(black%60))  yline(0, lcolor(red) lpattern(shortdash)) ///
xlabel (-1 " " 0 "No Centralization" 1 "Centralization" 2 " ", labsize(11pt) noticks) plot1opts(msize(medlarge) msymbol(square)) legend(off) ///
ylabel(,format(%9.1f) angle(0)) ///
ytitle("Marginal Change in Project Delays (%)", size(11pt) margin(r=1)) xtitle("" ) ///
title("{bf: Figure 5B. Conditional Turnover Effects by Agency Centralization (H3)}" "{bf:Aggregate Voluntary Turnover Model [MODEL 11]}", size(12pt) margin(medium)) ///
addplot(histogram cio5, yaxis(2) discrete barwidth(0.4) fcolor(gray%20) yscale(r(0 1.5) axis(2) alt) lc(gray%10) ytitle(,axis(2)) xlabel(-1 " " 0 "No Centralization" 1"Centralization" 2 " ", noticks) ylabel(0 "0" 0.5 "0.5" 1 "1.0" 1.5 "1.5" , format(%9.1f) angle(0) axis(2)) ylabel(, format(%9.1f) angle(0) axis(1))) xsize(6)
*
*
graph save "Graph" "C:\Users\hongj\Dropbox\2024 SPRING PROJECTS\Organizational Memory Paper\JPART Replication Datafiles\GRAPHICS\FIGURE 5B.04-29-2025.gph", replace

*
*
* ******************************************************************************************************************************************************************
*********************************************************************************

* [MODEL 12, FIGURE 6B] H4 STANDARDIZATION HYPOTHESIS
eststo: xtgee delay_pct c.voluntary##c.activityno_permil_pct c.volabove15_los15pct  cio5 lnitemp lnprojsize projects_no accrate  newprojects_pct  cio_tenure y1-y7 voluntaryb volabove15_los15pctb  activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb, fam(bin) link(probit) corr(uns) vce(robust)

* Aggregate Voluntary Turnover Rate: Marginal Effect Differentials Based on Interdecile Change in Task Standardization
margins , dydx(voluntary) at(activityno_permil_pct=($stdz_p10 $stdz_p90)) pwcompare(effects)

* [FIGURE 6B] Conditional Turnover Effects by Task Standardization (H4)
margins , dydx(voluntary) at(activityno_permil_pct=(0(0.1)1))
marginsplot, recast(connected) plot1opts(lcolor(black%60) mcolor(black%60))  ciopt(color(black%30)) yline(0, lcolor(red) lpattern(shortdash)) recastci(rarea) ///
legend(off) ylabel(,format(%9.1f) angle(0)) /// ///
xlabel(0 "0" 0.5 "50" 1 "100",format(%9.0f)) ylabel(,format(%9.1f) angle(0)) ///
ytitle("Marginal Change in Delayed Projects (%)", size(11pt) margin(r=1)) xtitle("Proportion of Standardized Projects (%)", size(11pt) margin(t=1)) ///
title("{bf: Figure 6B. Conditional Turnover Effects by Task Standardization (H4)}" "{bf:Aggregate Voluntary Turnover Model [MODEL 12]}", size(12pt) margin(medium)) ///
addplot(histogram activityno_permil_pct , yaxis(2) xaxis(1) fcolor(gray%20) lc(gray%10) yscale(axis(2) alt) xlabel(0 "0" 0.5 "50" 1 "100",format(%9.0f)) ylabel(,format(%9.1f) angle(0))  ylabel( ,format(%9.1f) angle(0) axis(2)) ytitle("",  axis(2))) xsize(6) 

graph save "Graph" "C:\Users\hongj\Dropbox\2024 SPRING PROJECTS\Organizational Memory Paper\JPART Replication Datafiles\GRAPHICS\FIGURE 6B.04-29-2025.gph", replace



***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
**# [MODELS 13 - 16, FIGURES 3C - 6C] AGGREGATE INVOLUNTARY TURNOVER MODELS *

* [MODEL 13, FIGURE 3C] H1: Aggregate Involuntary Turnover Baseline Effects
eststo: xtgee delay_pct c.involuntary c.activityno_permil_pct c.involabove15_los15pct i.cio5 lnitemp lnprojsize projects_no accrate  newprojects_pct  cio_tenure y1-y7 involuntaryb involabove15_los15pctb  activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb   , fam(bin) link(probit) corr(uns) vce(robust)

* Aggregate Involuntary Turnover Rate: Unconditional Marginal Effect 
margins, dydx(involuntary)

* Predicted Change in Delays Based on Interdecile Increase in Aggregate Involuntary Turnover Rate
margins, at(involuntary=($involuntary_p10 $involuntary_p90)) pwcompare(effects)

* [FIGURE 3C]
margins, at(involuntary=(0(0.005)0.07)) 
marginsplot, recast(connected) plot1opts(lcolor(black%60) mcolor(black%60))  ciopt(color(black%30)) recastci(rarea) ///
xlabel(0 "0" 0.02 "2" 0.04 "4" 0.06 "6", format(%9.0f) ) ylabel(0.1 "10" 0.2 "20" 0.3 "30" 0.4 "40" 0.5 "50",format(%9.0f) angle(0)) ///
legend(off) ///
ytitle("Predicted Project Delays (%)", size(11pt) margin(r=1)) xtitle("Aggregate Involuntary Turnover (%)", margin(t=1)  size(11pt) ) ///
title("{bf: Figure 3C. Unconditional Turnover Effects on Project Delays (H1)}" "{bf:Aggregate Involuntary Turnover Model [MODEL 13]}", size(12pt) margin(medium)) ///
addplot(histogram involuntary if involuntary<=0.07, fc(gray%20) lc(gray%10) yaxis(2) yscale(r(0 20) axis(2) alt) xlabel(0 "0" 0.02 "2" 0.04 "4" 0.06 "6",format(%9.0f)) ylabel(0.1 "10" 0.2 "20" 0.3 "30" 0.4 "40" 0.5 "50",format(%9.0f) angle(0)) ylabel(,format(%9.0f) angle(0) axis(2)) ytitle(,axis(2))) xsize(6) 

graph save "Graph" "C:\Users\hongj\Dropbox\2024 SPRING PROJECTS\Organizational Memory Paper\JPART Replication Datafiles\GRAPHICS\FIGURE 3C.04-29-2025.gph", replace

***************************************************************************************************************************************************************************************************************************************************

* [MODEL 14, FIGURE 4C] H2: Turnover X Service Length 
eststo: xtgee delay_pct c.involuntary##c.involabove15_los15pct c.activityno_permil_pct  i.cio5 lnitemp lnprojsize projects_no accrate  newprojects_pct  cio_tenure y1-y7 involuntaryb involabove15_los15pctb  activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb   , fam(bin) link(probit) corr(uns) vce(robust)

* Aggregate Involuntary Turnover Rate: Marginal Effect Differentials Based on Interdecile Change in Service Length
margins , dydx(involuntary) at(involabove15_los15pct=($invollos_p10 $invollos_p90)) pwcompare(effects)

* [FIGURE 4C]
margins , dydx(involuntary) at(involabove15_los15pct=(0(0.01)0.05))
marginsplot, recast(connected) plot1opts(lcolor(black%60) mcolor(black%60))  ciopt(color(black%30)) yline(0, lcolor(red) lpattern(shortdash)) recastci(rarea) ///
legend(off) ylabel(,format(%9.1f) angle(0)) /// 
xlabel(0 "0" 0.01 "1" 0.02 "2" 0.03 "3" 0.04 "4" 0.05 "5",format(%9.0f)) ///
ytitle("Marginal Change in Delayed Projects (%)", size(11pt) margin(r=1)) xtitle("Departures' Service Length (>15 years, %)", margin(t=1)  size(11pt)) ///
title("{bf: Figure 4C. Conditional Turnover Effects by Departures' Service Length (H2)}" "{bf:Aggregate Involuntary Turnover Model [MODEL 14]}", size(12pt) margin(medium)) ///
addplot(histogram involabove15_los15pct if involabove15_los15pct<=0.05, yaxis(2) xaxis(1)  fcolor(gray%20) yscale(axis(2) alt) lc(gray%10) xlabel(,format(%9.0f)) ylabel( ,format(%9.1f) angle(0) ) ylabel(,format(%9.0f) angle(0) axis(2)) ytitle(,axis(2))) xsize(6)
*
*
graph save "Graph" "C:\Users\hongj\Dropbox\2024 SPRING PROJECTS\Organizational Memory Paper\JPART Replication Datafiles\GRAPHICS\FIGURE 4C.04-29-2025.gph", replace



***************************************************************************************************************************************************************************************************************************************************

* [MODEL 15, FIGURE 5C] H3: Turnover X Agency Centralization
eststo: xtgee delay_pct c.involuntary##i.cio5 c.involabove15_los15pct c.activityno_permil_pct   lnitemp lnprojsize projects_no accrate  newprojects_pct  cio_tenure y1-y7 involuntaryb involabove15_los15pctb  activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb  , fam(bin) link(probit) corr(uns) vce(robust)

* Aggregate Involuntary Turnover Rate: Marginal Effect Differentials Based on Agency Centralization
margins , dydx(involuntary) over(cio5) pwcompare(effects)


* [FIGURE 5C]
margins , dydx(involuntary) over(cio5)
marginsplot, recast(scatter) plotopt(mcolor(black)) ciopt(color(black%60))  yline(0, lcolor(red) lpattern(shortdash)) ///
xlabel (-1 " " 0 "No Centralization" 1 "Centralization" 2 " ", labsize(11pt) noticks) plot1opts(msize(medlarge) msymbol(square)) legend(off) ///
ylabel( ,format(%9.1f) angle(0)) ysc(r(-4(1)2)) ///
ytitle("Marginal Change in Project Delays (%)", size(11pt) margin(r=1)) xtitle("" ) ///
title("{bf: Figure 5C. Conditional Turnover Effects by Agency Centralization (H3)}" "{bf:Aggregate Involuntary Turnover Model [MODEL 15]}", size(12pt) margin(medium)) ///
addplot(histogram cio5, yaxis(2) discrete barwidth(0.4) fcolor(gray%20) yscale(r(0 1.5) axis(2) alt) lc(gray%10) ytitle(,axis(2)) xlabel(-1 " " 0 "No Centralization" 1"Centralization" 2 " ", noticks) ylabel(0 "0" 0.5 "0.5" 1 "1.0" 1.5 "1.5" , format(%9.1f) angle(0) axis(2)) ylabel(, format(%9.1f) angle(0) axis(1))) xsize(6)
*
*
graph save "Graph" "C:\Users\hongj\Dropbox\2024 SPRING PROJECTS\Organizational Memory Paper\JPART Replication Datafiles\GRAPHICS\FIGURE 5C.04-29-2025.gph", replace



***************************************************************************************************************************************************************************************************************************************************

* [MODEL 16, FIGURE 6C] H4: Turnover X Task Standardization
eststo: xtgee delay_pct c.involuntary##c.activityno_permil_pct c.involabove15_los15pct  i.cio5 lnitemp lnprojsize projects_no accrate  newprojects_pct  cio_tenure y1-y7 involuntaryb involabove15_los15pctb  activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb   , fam(bin) link(probit) corr(uns) vce(robust)

* Aggregate Involuntary Turnover Rate: Marginal Effect Differentials Based on Interdecile Change in Task Standardization
margins , dydx(involuntary) at(activityno_permil_pct=($stdz_p10 $stdz_p90)) pwcompare(effects)


* [FIGURE 6C]
margins , dydx(involuntary) at(activityno_permil_pct=(0(0.1)1))
marginsplot, recast(connected) plot1opts(lcolor(black%60) mcolor(black%60))  ciopt(color(black%30)) yline(0, lcolor(red) lpattern(shortdash)) recastci(rarea) ///
legend(off) ylabel(,format(%9.1f) angle(0)) /// ///
xlabel(0 "0" 0.5 "50" 1 "100", format(%9.0f)) ylabel(,format(%9.1f) angle(0)) ///
ytitle("Marginal Change in Delayed Projects (%)", size(11pt) margin(r=1)) xtitle("Proportion of Standardized Projects (%)", size(11pt) margin(t=1)) ///
title("{bf: Figure 6C. Conditional Turnover Effects by Task Standardization (H4)}" "{bf:Aggregate Involuntary Turnover Model [MODEL 16]}", size(12pt) margin(medium)) ///
addplot(histogram activityno_permil_pct , yaxis(2) xaxis(1) fcolor(gray%20) lc(gray%10) yscale(axis(2) alt) xlabel(0 "0" 0.5 "50" 1 "100", format(%9.0f)) ylabel(,format(%9.1f) angle(0))  ylabel( ,format(%9.1f) angle(0) axis(2)) ytitle(,  axis(2))) xsize(6) 

graph save "Graph" "C:\Users\hongj\Dropbox\2024 SPRING PROJECTS\Organizational Memory Paper\JPART Replication Datafiles\GRAPHICS\FIGURE 6C.04-29-2025.gph", replace

*
****************************************************************************************************************************************************
** [TABLE A2. MODELS A9 - A16; AGGREGATE VOLUNTARY AND INVOLUNTARY TURNOVER MODELS]

cd "C:\Users\hongj\Dropbox\2024 SPRING PROJECTS\Organizational Memory Paper\JPART Replication Datafiles\OUTPUT\TABLES"

esttab est1 est2 est3 est4 using ManuscriptTable2.04-29-2025.rtf, ///
cells(b(star fmt(%9.3f)) se(par) p(fmt(3) par("[" "]"))) starl( * 0.10 ** 0.05 *** 0.010) label ///
title(TABLE 2. Fractional Panel Probit Analysis of the Impact of Aggregate Voluntary and Involuntary Turnover on IT Project Delays in U.S. Federal Agencies, FY2015−FY2021) ///
nonumbers mtitles("Model 9" "Model 10" "Model 11" "Model 12" )  ///
stats(year qic pseudor chi2 N, fmt(2) label("Year Fixed Effects" "QIC" "Pseudo R-Squared" "Wald" "N")) replace

esttab est5 est6 est7 est8 using ManuscriptTable2.04-29-2025.rtf, ///
cells(b(star fmt(%9.3f)) se(par) p(fmt(3) par("[" "]"))) starl( * 0.10 ** 0.05 *** 0.010) label ///
title(TABLE 2. Fractional Panel Probit Analysis of the Impact of Aggregate Voluntary and Involuntary Turnover on IT Project Delays in U.S. Federal Agencies, FY2015−FY2021) ///
nonumbers mtitles("Model 13" "Model 14" "Model 15" "Model 16")  ///
stats(year qic pseudor chi2 N, fmt(2) label("Year Fixed Effects" "QIC" "Pseudo R-Squared" "Wald" "N")) append
***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
**# [MODELS 17 - 20, FIGURES 3E - 6E] MANAGERIAL VOLUNTARY TURNOVER MODELS

discard

quietly: xtgee delay_pct c.turnover_gs13  gs13above15_los15pct cio5 activityno_permil_pct cio_tenure  lnitemp lnprojsize projects_no accrate  newprojects_pct y1-y7 turnover_gs13b gs13above15_los15pctb activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb, fam(bin) link(probit) corr(uns) vce(robust)

* [MODEL 17, FIGURE 3E] H1: Managerial Voluntary Turnover Baseline Effects
eststo: xtgee delay_pct c.voluntary_gs13 c.volgs13_los15pct cio5 activityno_permil_pct cio_tenure  lnitemp lnprojsize projects_no accrate  newprojects_pct y1-y7 c.voluntary_gs13b c.volgs13_los15pctb activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb   if e(sample), fam(bin) link(probit) corr(uns) vce(robust)

* Managerial Voluntary Turnover Rate: Unconditional Marginal Effect 
margins, dydx(voluntary_gs13)

* Predicted Change in Delays Based on Interdecile Increase in Managerial Voluntary Turnover Rate
margins, at(voluntary_gs13=($voluntary_gs13_p10 $voluntary_gs13_p90)) pwcompare(effects)

* [FIGURE 3E]
margins, at(voluntary_gs13=(0(0.01)0.15)) 
marginsplot, recast(connected) plot1opts(lcolor(black%60) mcolor(black%60))  ciopt(color(black%30)) recastci(rarea) ///
xlabel(0 "0" 0.05 "5" 0.1 "10" 0.15 "15",format(%9.0f) ) ylabel(0.1 "10" 0.2 "20" 0.3 "30" 0.4 "40" 0.5 "50",format(%9.0f) angle(0)) legend(off) ///
ytitle("Predicted Project Delays (%)", size(11pt) margin(r=1)) xtitle("Managerial Voluntary Turnover (%)", margin(t=1)  size(11pt) ) ///
title("{bf: Figure 3E. Unconditional Turnover Effects on Project Delays (H1)}" "{bf:Managerial Voluntary Turnover Model [MODEL 17]}", size(12pt) margin(medium)) ///
addplot(histogram voluntary_gs13 if voluntary_gs13<=0.15, fc(gray%20) lc(gray%10) yaxis(2) yscale(axis(2) alt) xlabel(0 "0" 0.05 "5" 0.1 "10" 0.15 "15",format(%9.0f)) ylabel(0.1 "10" 0.2 "20" 0.3 "30" 0.4 "40" 0.5 "50",format(%9.0f) angle(0)) ylabel(,format(%9.0f) angle(0) axis(2)) ytitle(,axis(2))) xsize(6) 

graph save "Graph" "C:\Users\hongj\Dropbox\2024 SPRING PROJECTS\Organizational Memory Paper\JPART Replication Datafiles\GRAPHICS\FIGURE 3E.04-29-2025.gph", replace

***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************

* [MODEL 18, FIGURE 4E] H2: Turnover X Service Length
eststo: xtgee delay_pct c.voluntary_gs13##c.volgs13_los15pct cio5 activityno_permil_pct cio_tenure  lnitemp lnprojsize projects_no accrate  newprojects_pct y1-y7 c.voluntary_gs13b##c.volgs13_los15pctb activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb   if e(sample), fam(bin) link(probit) corr(uns) vce(robust)

* Managerial Voluntary Turnover Rate: Marginal Effect Differentials Based on Interdecile Change in Service Length
margins , dydx(voluntary_gs13) at(volgs13_los15pct=($volgs13_los_p10 $volgs13_los_p90)) pwcompare(effects)

* [FIGURE 4E]
margins , dydx(voluntary_gs13) at(volgs13_los15pct=(0(0.025)0.2))
marginsplot, recast(connected) plot1opts(lcolor(black%60) mcolor(black%60))  ciopt(color(black%30)) yline(0, lcolor(red) lpattern(shortdash)) recastci(rarea) ///
legend(off) ylabel(,format(%9.1f) angle(0)) /// 
xlabel(1 "1" 5 "5" 10 "10" ,format(%9.0f)) ///
ytitle("Marginal Change in Delayed Projects (%)", size(11pt) margin(r=1)) xtitle("Departing Managers' Service Length (>15 years, %)", margin(t=1)  size(11pt)) ///
title("{bf: Figure 4E. Conditional Turnover Effects by Departures' Service Length (H2)}" "{bf:Managerial Voluntary Turnover Model [MODEL 18]}", size(12pt) margin(medium)) ///
addplot(histogram volgs13_los15pct if volgs13_los15pct<=0.2 , yaxis(2) xaxis(1)  fcolor(gray%20) yscale(axis(2) alt) lc(gray%10) xlabel(0 "0" 0.1 "10" 0.2 "20" ,format(%9.0f)) ylabel( ,format(%9.1f) angle(0) ) ylabel(,format(%9.1f) angle(0) axis(2)) ytitle(,axis(2))) xsize(6)


graph save "Graph" "C:\Users\hongj\Dropbox\2024 SPRING PROJECTS\Organizational Memory Paper\JPART Replication Datafiles\GRAPHICS\FIGURE 4E.04-29-2025.gph", replace
***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************

* [MODEL 19, FIGURE 5E] H3: Turnover X Agency Centralization
eststo: xtgee delay_pct c.voluntary_gs13##i.cio5 c.volgs13_los15pct  activityno_permil_pct cio_tenure  lnitemp lnprojsize projects_no accrate  newprojects_pct y1-y7 c.voluntary_gs13b c.volgs13_los15pctb activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb   if e(sample), fam(bin) link(probit) corr(uns) vce(robust)

* Managerial Voluntary Turnover Rate: Marginal Effect Differentials Based on Agency Centralization
margins , dydx(voluntary_gs13) over(cio5) pwcompare(effects)

* [FIGURE 5E]
margins , dydx(voluntary_gs13) over(cio5)
marginsplot, recast(scatter) plotopt(mcolor(black)) ciopt(color(black%60))  yline(0, lcolor(red) lpattern(shortdash)) ///
xlabel (-1 " " 0 "No Centralization" 1 "Centralization" 2 " ", labsize(11pt) noticks) plot1opts(msize(medlarge) msymbol(square)) legend(off) ///
ylabel(,format(%9.1f) angle(0)) ///
ytitle("Marginal Change in Project Delays (%)", size(11pt) margin(r=1)) xtitle("" ) ///
title("{bf: Figure 5E. Conditional Turnover Effects by Agency Centralization (H3)}" "{bf:Managerial Voluntary Turnover Model [MODEL 19]}", size(12pt) margin(medium)) ///
addplot(histogram cio5, yaxis(2) discrete barwidth(0.4) fcolor(gray%20) yscale(r(0 1.5) axis(2) alt) lc(gray%10) ytitle(,axis(2)) xlabel(-1 " " 0 "No Centralization" 1"Centralization" 2 " ", noticks) ylabel(0 "0" 0.5 "0.5" 1 "1.0" 1.5 "1.5" , format(%9.1f) angle(0) axis(2)) ylabel(, format(%9.1f) angle(0) axis(1))) xsize(6)
*
*
graph save "Graph" "C:\Users\hongj\Dropbox\2024 SPRING PROJECTS\Organizational Memory Paper\JPART Replication Datafiles\GRAPHICS\FIGURE 5E.04-29-2025.gph", replace
***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************

* [MODEL 20, FIGURE 6E] H4 : Turnover X Task Standardization
eststo: xtgee delay_pct c.voluntary_gs13##c.activityno_permil_pct i.cio5 c.volgs13_los15pct   cio_tenure  lnitemp lnprojsize projects_no accrate  newprojects_pct y1-y7 c.voluntary_gs13b c.volgs13_los15pctb activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb   if e(sample), fam(bin) link(probit) corr(uns) vce(robust)

* Managerial Voluntary Turnover Rate: Marginal Effect Differentials Based on Interdecile Change in Task Standardization
margins , dydx(voluntary_gs13) at(activityno_permil_pct=($stdz_p10 $stdz_p90)) pwcompare(effects)


* [FIGURE 6E]
margins , dydx(voluntary_gs13) at(activityno_permil_pct=(0(0.1)1))
marginsplot, recast(connected) plot1opts(lcolor(black%60) mcolor(black%60))  ciopt(color(black%30)) yline(0, lcolor(red) lpattern(shortdash)) recastci(rarea) ///
legend(off) ylabel(,format(%9.1f) angle(0)) /// ///
xlabel(0 "0" 0.5 "50" 1 "100",format(%9.0f)) ylabel(,format(%9.1f) angle(0)) ///
ytitle("Marginal Change in Delayed Projects (%)", size(11pt) margin(r=1)) xtitle("Proportion of Standardized Projects (%)", size(11pt) margin(t=1)) ///
title("{bf: Figure 6E. Conditional Turnover Effects by Task Standardization (H4)}" "{bf:Managerial Voluntary Turnover Model [MODEL 20]}", size(12pt) margin(medium)) ///
addplot(histogram activityno_permil_pct , yaxis(2) xaxis(1) fcolor(gray%20) lc(gray%10) yscale(r(0 20) axis(2) alt) xlabel(0 "0" 0.5 "50" 1 "100",format(%9.0f))  ylabel(0 "0" 10 "10" 20 "20",format(%9.1f) angle(0) axis(2)) ytitle(,  axis(2))) xsize(6) 

graph save "Graph" "C:\Users\hongj\Dropbox\2024 SPRING PROJECTS\Organizational Memory Paper\JPART Replication Datafiles\GRAPHICS\FIGURE 6E.04-29-2025.gph", replace



************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************


**# [MODELS 21 - 24, FIGURES 3F - 6F] MANAGERIAL INVOLUNTARY TURNOVER MODELS


quietly: xtgee delay_pct c.turnover_gs13  gs13above15_los15pct cio5 activityno_permil_pct cio_tenure  lnitemp lnprojsize projects_no accrate  newprojects_pct y1-y7 turnover_gs13b gs13above15_los15pctb activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb, fam(bin) link(probit) corr(uns) vce(robust)

* [MODEL 21, FIGURE 3F] H1: Managerial Involuntary Turnover Baseline Effects
eststo: xtgee delay_pct c.involuntary_gs13 c.involgs13_los15pct cio5 activityno_permil_pct cio_tenure  lnitemp lnprojsize projects_no accrate  newprojects_pct y1-y7 c.involuntary_gs13b  c.involgs13_los15pctb activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb   if e(sample), fam(bin) link(probit) corr(uns) vce(robust)
*
*Managerial Involuntary Turnover Rate: Unconditional Marginal Effect 
margins, dydx(involuntary_gs13)

* Predicted Change in Delays Based on Interdecile Increase in Managerial Involuntary Turnover Rate
margins, at(involuntary_gs13=($involuntary_gs13_p10 $involuntary_gs13_p90)) pwcompare(effects)

* [FIGURE 3F]
margins, at(involuntary_gs13=(0(0.005)0.04)) 
marginsplot, recast(connected) plot1opts(lcolor(black%60) mcolor(black%60))  ciopt(color(black%30)) recastci(rarea) ///
xlabel(0 "0" 0.02 "2" 0.04 "4", format(%9.0f) ) ylabel(0.1 "10" 0.2 "20" 0.3 "30" 0.4 "40" 0.5 "50",format(%9.0f) angle(0))  legend(off) ///
ytitle("Predicted Project Delays (%)", size(11pt) margin(r=1)) xtitle("Managerial Involuntary Turnover (%)", margin(t=1)  size(11pt) ) ///
title("{bf: Figure 3F. Unconditional Turnover Effects on Project Delays (H1)}" "{bf:Managerial Involuntary Turnover Model [MODEL 21]}", size(12pt) margin(medium)) ///
addplot(histogram involuntary if involuntary<=0.04, fc(gray%20) lc(gray%10) yaxis(2) yscale(r(0 20) axis(2) alt) xlabel(0 "0" 0.02 "2" 0.04 "4",format(%9.0f)) ylabel(0.1 "10" 0.2 "20" 0.3 "30" 0.4 "40" 0.5 "50",format(%9.0f) angle(0))  ylabel(,format(%9.0f) angle(0) axis(2)) ytitle(,axis(2))) xsize(6) 

graph save "Graph" "C:\Users\hongj\Dropbox\2024 SPRING PROJECTS\Organizational Memory Paper\JPART Replication Datafiles\GRAPHICS\FIGURE 3F.04-29-2025.gph", replace
*
*
* [MODEL 22, FIGURE 4F] H2: Turnover X Service Length
eststo: xtgee delay_pct c.involuntary_gs13##c.involgs13_los15pct cio5 activityno_permil_pct cio_tenure  lnitemp lnprojsize projects_no accrate  newprojects_pct y1-y7 c.involuntary_gs13b  c.involgs13_los15pctb activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb   if e(sample), fam(bin) link(probit) corr(uns) vce(robust)

* Managerial Involuntary Turnover Rate: Marginal Effect Differentials Based on Interdecile Change in Service Length
margins , dydx(involuntary_gs13) at(involgs13_los15pct=($involgs13_los_p10 $involgs13_los_p90)) pwcompare(effects)

* [FIGURE 4F]
margins , dydx(involuntary_gs13) at(involgs13_los15pct=(0(0.01)0.05))
marginsplot, recast(connected) plot1opts(lcolor(black%60) mcolor(black%60))  ciopt(color(black%30)) yline(0, lcolor(red) lpattern(shortdash)) recastci(rarea) ///
legend(off) ylabel(,format(%9.1f) angle(0)) /// ///
xlabel(0 "0" 0.01 "1" 0.02 "2" 0.03 "3" 0.04 "4" 0.05 "5",format(%9.0f)) ///
ytitle("Marginal Change in Delayed Projects (%)", size(11pt) margin(r=1)) xtitle("Departing Managers' Service Length (>15 years, %)", margin(t=1)  size(11pt)) ///
title("{bf: Figure 4F. Conditional Turnover Effects by Departures' Service Length (H2)}" "{bf:Managerial Involuntary Turnover Model [MODEL 22]}", size(12pt) margin(medium)) ///
addplot(histogram involgs13_los15pct if involgs13_los15pct<=0.05, yaxis(2) xaxis(1)  fcolor(gray%20) yscale(axis(2) alt) lc(gray%10) xlabel(0 "0" 0.01 "1" 0.02 "2" 0.03 "3" 0.04 "4" 0.05 "5",format(%9.0f)) ylabel( ,format(%9.1f) angle(0) ) ylabel(,format(%9.0f) angle(0) axis(2)) ytitle(,axis(2))) xsize(6)
*
*
graph save "Graph" "C:\Users\hongj\Dropbox\2024 SPRING PROJECTS\Organizational Memory Paper\JPART Replication Datafiles\GRAPHICS\FIGURE 4F.04-29-2025.gph", replace


* [MODEL 23, FIGURE 5F] H3 : DOES NOT CONVERGE.

eststo: xtgee delay_pct c.involuntary_gs13##i.cio5 c.involgs13_los15pct  activityno_permil_pct cio_tenure  lnitemp lnprojsize projects_no accrate  newprojects_pct y1-y7 c.involuntary_gs13b  c.involgs13_los15pctb activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb   if e(sample), fam(bin) link(probit) corr(uns) vce(robust)

* [FIGURE 5F]
margins , dydx(involuntary_gs13) over(cio5)
marginsplot, recast(scatter) plotopt(mcolor(white)) ciopt(color(black%0))  yline(0, lcolor(red) lpattern(shortdash)) ///
text(-5 0 "Not Reported", placement(south)) ///
text(-5 1 "Not Reported", placement(south)) ///
xlabel (-1 " " 0 "No Centralization" 1 "Centralization" 2 " ", labsize(11pt) noticks) plot1opts(msize(medlarge) msymbol(square)) legend(off) ///
ylabel( ,format(%9.1f) angle(0)) ///
ytitle("Marginal Change in Project Delays (%)", size(11pt) margin(r=1)) xtitle("" ) ///
title("{bf: Figure 5F. Conditional Turnover Effects by Agency Centralization (H3)}" "{bf:Managerial Involuntary Turnover Model [MODEL 23]}", size(12pt) margin(medium)) ///
addplot(histogram cio5 if cio5>1, yaxis(2) discrete barwidth(0.4) fcolor(gray%20) yscale(r(0 1.5) axis(2) alt) lc(gray%10) ytitle(,axis(2)) xlabel(-1 " " 0 "No Centralization" 1"Centralization" 2 " ", noticks) ylabel(0 "0" 0.5 "0.5" 1 "1.0" 1.5 "1.5" , format(%9.1f) angle(0) axis(2)) ylabel(, format(%9.1f) angle(0) axis(1))) xsize(6)

*
*
graph save "Graph" "C:\Users\hongj\Dropbox\2024 SPRING PROJECTS\Organizational Memory Paper\JPART Replication Datafiles\GRAPHICS\FIGURE 5F.04-29-2025.gph", replace


* [MODEL 24, FIGURE 6F] H4 : Turnover X Task Standardization

eststo: xtgee delay_pct c.involuntary_gs13##c.activityno_permil_pct i.cio5 c.involgs13_los15pct   cio_tenure  lnitemp lnprojsize projects_no accrate  newprojects_pct y1-y7 c.involuntary_gs13b  c.involgs13_los15pctb activityno_permil_pctb lnitempb lnprojsizeb projects_nob accrateb newprojects_pctb cio_tenureb   dmeratio_totalspending dmeratio_totalspendingb  , fam(bin) link(probit) corr(uns) vce(robust)

* Managerial Involuntary Turnover Rate: Marginal Effect Differentials Based on Interdecile Change in Task Standardization
margins , dydx(involuntary_gs13) at(activityno_permil_pct=($stdz_p10 $stdz_p90)) pwcompare(effects)


* [FIGURE 6F]
margins , dydx(involuntary_gs13) at(activityno_permil_pct=(0(0.1)1))
marginsplot, recast(connected) plot1opts(lcolor(black%60) mcolor(black%60))  ciopt(color(black%30)) yline(0, lcolor(red) lpattern(shortdash)) recastci(rarea) ///
legend(off) ylabel(,format(%9.1f) angle(0)) /// ///
xlabel(0 "0" 0.5 "50" 1 "100",format(%9.0f)) ylabel(,format(%9.1f) angle(0)) ///
ytitle("Marginal Change in Delayed Projects (%)", size(11pt) margin(r=1)) xtitle("Proportion of Standardized Projects (%)", size(11pt) margin(t=1)) ///
title("{bf: Figure 6F. Conditional Turnover Effects by Task Standardization (H4)}" "{bf:Managerial Involuntary Turnover Model [MODEL 24]}", size(12pt) margin(medium)) ///
addplot(histogram activityno_permil_pct , yaxis(2) xaxis(1) fcolor(gray%20) lc(gray%10) yscale(axis(2) alt) xlabel(0 "0" 0.5 "50" 1 "100",format(%9.0f)) ylabel(,format(%9.1f) angle(0))  ylabel( ,format(%9.1f) angle(0) axis(2)) ytitle(,  axis(2))) xsize(6) 

graph save "Graph" "C:\Users\hongj\Dropbox\2024 SPRING PROJECTS\Organizational Memory Paper\JPART Replication Datafiles\GRAPHICS\FIGURE 6F.04-29-2025.gph", replace

*
*
****************************************************************************************************************************************************
*
cd "C:\Users\hongj\Dropbox\2024 SPRING PROJECTS\Organizational Memory Paper\JPART Replication Datafiles\OUTPUT\TABLES"

esttab est1 est2 est3 est4 using ManuscriptTable3.04-29-2025.rtf, ///
cells(b(star fmt(%9.3f)) se(par) p(fmt(3) par("[" "]"))) starl( * 0.10 ** 0.05 *** 0.010) label ///
title(TABLE 3. Fractional Panel Probit Analysis of the Impact of Managerial Voluntary and Involuntary Turnover on IT Project Delays in U.S. Federal Agencies, FY2015−FY2021) ///
nonumbers mtitles("Model 17" "Model 18" "Model 19" "Model 20" )  ///
stats(year qic pseudor chi2 N, fmt(2) label("Year Fixed Effects" "QIC" "Pseudo R-Squared" "Wald" "N")) replace


esttab est5 est6 est7 est8 using ManuscriptTable3.04-29-2025.rtf, ///
cells(b(star fmt(%9.3f)) se(par) p(fmt(3) par("[" "]"))) starl( * 0.10 ** 0.05 *** 0.010) label ///
title(TABLE 3. Fractional Panel Probit Analysis of the Impact of Managerial Voluntary and Involuntary Turnover on IT Project Delays in U.S. Federal Agencies, FY2015−FY2021) ///
nonumbers mtitles("Model 21" "Model 22" "Model 23" "Model 24")  ///
stats(year qic pseudor chi2 N, fmt(2) label("Year Fixed Effects" "QIC" "Pseudo R-Squared" "Wald" "N")) append
***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
log close